<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
	<title>{:C('SERVER_HOME_NAME')}</title>
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/login.css">
</head>
<body>
	<!-- <div class="header"><img src="__PUBLIC__/images/logo.png"></div> -->
	<div class="login">
		<div class="login-box">
			<div class="login-img m40"><img src="__PUBLIC__/images/logo.png"></div>
			<div class="login-form"><input id="idInput" class="formIpt" type="text" value="admin" placeholder="用户名"></div>
			<div class="login-form"><input id="pwInput" class="formIpt" type="password" value="111111" placeholder="密码"></div>
			<div class="login-form"><input id="verification" class="login-code" type="code" placeholder="验证码"><div class="code-img"> <img src="{:U('Home/Login/yanzheng')}" onclick='this.src=this.src+"?"+Math.random();'/></div></div>
			<div class="login-panel"><a href="{:U('User/backPassword_step1')}" class="font-color fr">忘记密码 </a></div>
			<div class="login-btn"><a href="javascript:void(0);" class="btnlogin">登&nbsp;&nbsp;&nbsp;&nbsp;录</a></div>
			<div class="login-panel"><a href="{:U('Home/Login/register')}" class="register-now">还没有账号？立即注册 </a></div></div>
		</div>		

	</div>
	<include file="Public/ok" />
	
	
	<script src="__PUBLIC__/js/jquery-1.7.min.js"></script>
	<script src="__PUBLIC__/js/page.js"></script>
	<script type="text/javascript">
		$(".btnlogin").click(function () {

			var username=$("#idInput").val(),
				password=$("#pwInput").val(),
				code=$("#verification").val();

			if (username=="") {
				prompting("用户名不能为空");return false;
			}else if (password=="") {
				prompting("密码不能为空");return false;
			}else if (code=="") {
				prompting("验证码不能为空");return false;
			}else{

				 $.post('__URL__/login', {username:username,password:password,code:code}, function(data) {

				 	  var o = eval("("+data+")");// 将json转换为对象 json 格式
				 	  if(o.code==100){
				 	  	prompting(o.mess); return false;
				 	  }else{
				 	  	window.location.href="__APP__/Home/User/index.html";		
				 	  }
				 });
			}
		})


	</script>
</body>
</html>

